<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:73:"E:\WWW\huzhanwang.cc\public/../application/admin\view\adminlog\index.html";i:1670904725;s:60:"E:\WWW\huzhanwang.cc\application\admin\view\common\meta.html";i:1670904727;}*/ ?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>列表</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/admin/layuiadmin/style/admin.css" media="all">
  <script src="/static/echarts/echarts.js"></script>
  <script src="/static/admin/js/jquery-1.8.3.min.js"></script>
  <script src="/static/mods/notify_stand.js"></script>
</head>
<script>
  function clickimg(obj,img_tis){
    var img=$('#'+img_tis).val();
    console.log(img)
    var imgs=img.split(',');
    var arr=new Array();
    for(var i=0;i<imgs.length;i++){
      if(imgs[i]){
        if(i!=$(obj).index()){
        arr.push(imgs[i]);
      }
      }
    }
    $(obj).parent().remove();
    console.log(arr);
    $('#'+img_tis).val(arr.join(','));
    notify.success("操作成功", 'topRight');
}
function previewImg(obj) {
    var img = new Image(); 
    img.src = obj.src;
    //var height = img.height + 50; // 原图片大小
    //var width = img.width; //原图片大小
    var imgHtml = "<img src='" + obj.src + "' width='500px' height='500px'/>"; 
    //弹出层
    layer.open({ 
      type: 1, 
      shade: 0.8,
      offset: 'auto',
      area: [501 + 'px',551+'px'], // area: [width + 'px',height+'px'] //原图显示
      shadeClose:true,
      scrollbar: false,
      title: "图片预览", //不显示标题 
      content: imgHtml, //捕获的元素，注意：最好该指定的元素要存放在body最外层，否则可能被其它的相对元素所影响 
      cancel: function () { 
        //layer.msg('捕获就是从页面已经存在的元素上，包裹layer的结构', { time: 5000, icon: 6 }); 
      } 
    }); 
  }
</script>
<style>
  .previewImg{
    width: 100px;
    cursor:pointer;
  }
  .layui-btn_text{
    color: #009688;
    cursor:pointer;
  }
  .layui-btn_text-danger{
    color: #FF5722;
  }
  .layui-btn_text-danger:hover {
    color: #ff3c00;
}
.imgs_posi{
    position: relative;
    width: 200px;
    float: left;
  }

  .imgs_posi img{
    width: 100%;
  }
  .img_ab{
    position: absolute;
    right: 10px;
    top:5px;
    background-color: aliceblue;
    color: #333;
    font-size: 16px;
    height: 20px;
    line-height: 20px;
    width: 20px;
    text-align: center;
    border-radius: 20px;
    cursor: pointer;
  }
  .layui-elem-quote{
    overflow: hidden;
  }
</style>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card" style="padding-bottom: 100px;">
            <div style="width: 96%;margin: 0 auto;">
              <div class="layui-form" style="padding-top: 30px;">
                <div class="layui-form-item">
                  <div class="layui-inline">
                    <label class="layui-form-label">时间范围</label>
                        <div class="layui-input-inline">
                          <input type="text" class="layui-input" id="test10" placeholder="年-月-日 - 年-月-日" autocomplete="off">
                        </div>
                        <div class="layui-input-inline">
                          <input type="text" name="kay" id="kay" autocomplete="off" placeholder="请输入操作者" class="layui-input">
                        </div>
                    <button class="layui-btn layui-btn-sm" id="sub">提交</button>
                  </div>
                </div>
              </div>
              <table class="layui-hide" id="demo" lay-filter="test"></table>
              </div>
          </div>
        </div>
      </div>
  </div>
<script type="text/html" id="toolbarDemo">
  <div class="layui-btn-container">
    <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="dels">批量删除</button>
  </div>
</script>
<script type="text/html" id="barDemo">
</script>
<script src="/static/layui/layui.js"></script>
  <script type="text/html" id="switchTpl">
  	 <input type="checkbox" name="sta" value="{{d.id}}" lay-skin="switch" lay-filter="sta" lay-text="是|否"  {{ d.sta == 1 ? 'checked' : '' }}>
  </script>
<script>
layui.use(['laydate', 'laypage', 'layer', 'table', 'carousel', 'upload', 'element'], function(){
  var laydate = layui.laydate //日期
  ,laypage = layui.laypage //分页
  ,layer = layui.layer //弹层
  ,table = layui.table //表格
  ,carousel = layui.carousel //轮播
  ,upload = layui.upload //上传
  ,element = layui.element //元素操作
  ,$ = layui.$
	,form = layui.form;
 //日期时间范围
  laydate.render({
    elem: '#test10'
    ,type: 'datetime'
	,range: ','
	,format: 'yyyy-M-d'
  });
  //执行一个 table 实例
  table.render({
    elem: '#demo'
    ,url: '<?php echo url("adminlog/datas"); ?>' //数据接口
    ,page: true //开启分页
	, id: 'testReload'
  ,toolbar: '#toolbarDemo'
  // ,totalRow:true
    ,cols: [[ //表头
      {type: 'checkbox', fixed: 'left'}
      // ,{field: 'id', title: 'ID', sort: true, fixed: 'left', totalRowText: '合计：'}
      ,{field: 'adminname', title: '操作者', width:120}
      ,{field: 'title', title: '列表', width:120}
      ,{field: 'save', title: '操作', width:120}

      ,{field: 'createtime', title: '操作时间', width:200}
      ,{field: 'ip', title: 'ip', width:200}
      ,{field: 'com', title: '操作内容'}
    ]]
  });

  //工具栏事件
  table.on('toolbar(test)', function(obj){
  var checkStatus = table.checkStatus(obj.config.id);
  switch(obj.event){
    case 'dels':
      var data = checkStatus.data;
      if(data.length==0){
        notify.error("请先选择要删除数据", 'topRight');
        return;
      }
      var ids=new Array();
      for(var i=0;i<data.length;i++){
        if(data[i]){
          ids.push(data[i].id);
        }
      }
      ids=ids.join(',');
      layer.confirm('确定要批量删除吗？', function(index){
        // layer.msg(data.id, {time: 2000});
        $.post("<?php echo url('adminlog/dels_list'); ?>",{ids:ids},function(res){
          layer.closeAll();
          if(res.code=='200'){
            table.reload('testReload');
            notify.success('操作成功', 'topRight');
            //layer.close(index);
            }else{
              notify.error(res.msg, 'topRight');
            //layer.msg(res.msg, {time: 2000});
          }
        },'json');
      })
    break;



  };
});
	//搜索
  $('#sub').click(function () {
    var kay=$('#kay').val();
	var time=$('#test10').val();
    table.reload('testReload', {
    url: '<?php echo url("adminlog/datas"); ?>'
    // ,methods:"post"
    ,where: {
      kay : kay,
      time:time,
    }
    ,page: {
     curr: 1
    }
    });
   })
});
</script>
</body>
</html>        
